<template>
   <a-col 
    :span="projectColOpt.iconOperation.span || 0" 
    :col="projectColOpt.iconOperation.col || 0" 
    class="right-wrap"
    v-if="showModal">
    <div class="head-operation-icon-wrap">
      <div @click="backStackRoutes('operationIssue')">
        <img src="/static/operation.png" alt="" />
        <span class="textClass">运营发布</span>
      </div>
      <div @click="backStackRoutes('demandIssue')">
        <img src='/static/requestIcon.png' alt="" />
        <span class="textClass">需求发布</span>
      </div>
    </div>
  </a-col>
</template>
<script>
import { isVisibleStatus } from '@/utils/gettingEnv'
import headerOperationMixin from './headOperationMixin'

export default {
  name: 'IconQuickJump',
  mixins: [headerOperationMixin],
  props: {
    projectColOpt: Object
  },
  data() {
    return{}
  },
  methods: {
    backStackRoutes(key) {
      if (this.account && this.account !== '游客') {
        this.$router.push({ name: key, query: { key } })
      } else {
        const page = this.getPath(key)
        this.$router.push({
          path: '/login',
          query: { redirect: page.toRouter, key }
        })
      }
    }
  },
  computed: {
    showModal() {
      return isVisibleStatus('HeaderOperation', 'quickJump')
    }
  }
}
</script>